package  toUse{
	import rule.IFlyBehavior;
	import rule.IQuackBehavior;
	
	/**
	 * ...
	 * @author wibrst@qq.com
	 */
	public /*abstract*/ class Duck{
		
		public function Duck() {
		}
		
		public function setFlyBehavior( fb:IFlyBehavior ):void {
			this.flyBehavior = fb;
		}
		
		public function setQuackBehavior( qb:IQuackBehavior ):void {
			this.quackBehavior = qb;
		}
		
		public function do_quack():void {
			this.quackBehavior.quack();		/// delegate to behavior class
		}
		
		public function do_fly():void {
			this.flyBehavior.fly();		/// delegate to behavior class
		}
		
		public function swim():void {
			
		}
		
		public function display():void {
			
		}
		
		protected var flyBehavior:IFlyBehavior;
		protected var quackBehavior:IQuackBehavior;
		
	}  

}